<script setup lang="ts">
interface Props {
  title: string;
}
defineProps<Props>();
</script>

<template>
  <div class="home-panel">
    <div class="header">
      <h4>{{ title }}</h4>
      <RouterLink to="/" class="xtx-more">
        <span>查看全部</span>
        <i class="iconfont icon-angle-right"></i>
      </RouterLink>
    </div>
    <!-- 商品列表 -->
    <div class="goods-list">
      <RouterLink to="/" v-for="item in 4" :key="item" class="goods-item">
        <img
          src="https://yanxuan-item.nosdn.127.net/e13249bcbf667bb7779738b9869bb343.jpg"
          alt=""
        />
        <p class="name ellipsis">云游极轻便携旅行茶具快客杯一壶两杯</p>
        <p class="desc ellipsis">茶咖酒具</p>
        <p class="price">&yen;239.00</p>
      </RouterLink>
    </div>
  </div>
</template>

<style scoped lang="less">
.home-panel {
  background-color: #fff;
  padding: 0 20px;
  margin-top: 20px;
  height: 400px;
  .header {
    height: 66px;
    border-bottom: 1px solid #f5f5f5;
    padding: 18px 0;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    h4 {
      font-size: 22px;
      font-weight: normal;
    }
    .xtx-more {
      margin-bottom: 2px;
      span {
        font-size: 16px;
        vertical-align: middle;
        margin-right: 4px;
        color: #999;
      }
      i {
        font-size: 14px;
        vertical-align: middle;
        position: relative;
        top: 2px;
        color: #ccc;
      }
      &:hover {
        span,
        i {
          color: @xtxColor;
        }
      }
    }
  }
  .goods-list {
    display: flex;
    .goods-item {
      display: block;
      width: 220px;
      padding: 20px 30px;
      text-align: center;
      .hoverShadow();
      img {
        width: 160px;
        height: 160px;
      }
      p {
        padding-top: 10px;
      }
      .name {
        font-size: 16px;
      }
      .desc {
        color: #999;
        height: 29px;
      }
      .price {
        color: @priceColor;
        font-size: 20px;
      }
    }
  }
}
</style>
